<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #colorpiker {
            width: 350px;
            height: 240px;
            position: absolute;
            border: 1px solid #ebeef5;
            border-radius: 4px;
            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
            /* top:10px; */
        }

        .left-palette {
            position: absolute;
            display: inline-block;
            width: 300px;
            height: 180px;
            top: 10px;
            left: 10px;
            background-color: rgb(255, 0, 0);
        }

        .left-palette .left-palette-black {
            background:linear-gradient(0deg,#000,transparent);
            cursor: pointer;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

        .left-palette .left-palette-black::before {
            border-radius: 50%;
            width: 6px;
            height: 6px;
            background-color: transparent;
            box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, .3), 0 0 1px 2px rgba(0, 0, 0, .4);
            position: absolute;
            left: -10px;
            top: -2px;
            display: block;
            content: '';
        }

        .left-palette .spot {
            position: absolute;
        }

        .right-palette {
            position: absolute;
            display: inline-block;
            left: 320px;
            width: 20px;
            height: 180px;
            top: 10px;
            background: linear-gradient(180deg, red 0, #ff0 17%, lime 33%, cyan 50%, blue 67%, #f0f 83%, red);
        }

        .right-palette .rule {
            position: absolute;
            top: 10px;
            left: 0;
            width: 100%;
            height: 4px;
            background-color: rgba(255, 255, 255);
            cursor: pointer;
        }

        .tone {
            position: absolute;
            left: 10px;
            bottom: 10px;
            width: 80px;
            height: 25px;
        }

        .rgb-inner {
            position: absolute;
            width: 60px;
            height: 25px;
            line-height: 25px;
            bottom: 10px;
            right: 10px;
            border: 1px solid #ebeef5;
            border-radius: 4px;
            font-size: 10px;
            text-align: center;
        }

        #showColor {
            position: relative;
            width: 30px;
            height: 30px;
            background-color: gray;
        }
    </style>
</head>

<body>
    <div id="showColor"></div>
    <div id="colorpiker">
        <!-- <div class="left-palette" id="left_palette">
				<div class="left-palette-black"></div>
				<span class="spot" id="palette_spot"></span>
			</div>
			<div class="right-palette" id="right_palette">
				<span class="rule" id="palette_rule"></span>
			</div>
			<div class="tone" id="tone"></div>
			<div id="rgbInner"></div> -->
    </div>
    <p>skr</p>
    <p>skr</p>
    <p>skr</p>
    <p>skr</p>
    <p>skr</p>
    <p>skr</p>

    <p>skr</p><p>skr</p>
    <p>skr</p><p>skr</p>
    <script type="text/javascript">
        function Colorpiker() {}
        var _this = new Colorpiker()


        document.getElementById('colorpiker').addEventListener('mousedown', function () {
            console.log(_this.last_color)
            document.getElementById('showColor').style.backgroundColor = _this.last_color
            document.body.addEventListener('mousemove', function () {
                // console.log('ks')
                document.getElementById('showColor').style.backgroundColor = _this.last_color
            })
        })

    </script>
    <script src="./black.js"></script>
</body>

</html>